package com.applet.utils.baidu;

import com.applet.utils.HttpClient.HttpRequestProxy;

import java.util.Map;

public class BaiduYingYanUtil {

	private static String recEncoding = "UTF-8";
	public static String getRecEncoding() {
		return recEncoding;
	}
	public static void setRecEncoding(String recEncoding) {
		BaiduYingYanUtil.recEncoding = recEncoding;
	}

	public String addEntity(Map params){
		String url = "http://api.map.baidu.com/trace/v2/entity/add";
		return HttpRequestProxy.doPost(url, params, getRecEncoding());
	}

	public String deleteEntity(Map params){
		String url = "http://api.map.baidu.com/trace/v2/entity/delete";
		return HttpRequestProxy.doPost(url, params, getRecEncoding());
	}

	public String updateEntity(Map params){
		String url = "http://yingyan.baidu.com/api/v3/entity/update";
		return HttpRequestProxy.doPost(url, params, getRecEncoding());
	}

	public String listEntity(Map params){
		String url = "http://api.map.baidu.com/trace/v2/entity/list";
		return HttpRequestProxy.doGet(url, params , getRecEncoding());
	}

	public String addcolumnEntity(Map params){
		String url = "http://api.map.baidu.com/trace/v2/entity/addcolumn";
		return HttpRequestProxy.doPost(url, params , getRecEncoding());
	}

	public String deletecolumnEntity(Map params){
		String url = "http://api.map.baidu.com/trace/v2/entity/deletecolumn";
		return HttpRequestProxy.doPost(url, params , getRecEncoding());
	}

	public String listcolumnEntity(Map params){
		String url = "http://api.map.baidu.com/trace/v2/entity/listcolumn";
		return HttpRequestProxy.doGet(url, params , getRecEncoding());
	}

	public String createFence(Map params){
		String url = "http://api.map.baidu.com/trace/v2/fence/create";
		return HttpRequestProxy.doPost(url, params , getRecEncoding());
	}

	public String deleteFence(Map params){
		String url = "http://api.map.baidu.com/trace/v2/fence/delete";
		return HttpRequestProxy.doPost(url, params , getRecEncoding());
	}

	public String updateFence(Map params){
		String url = "http://api.map.baidu.com/trace/v2/fence/update";
		return HttpRequestProxy.doPost(url, params , getRecEncoding());
	}

	public String listFence(Map params){
		String url = "http://api.map.baidu.com/trace/v2/fence/list";
		return HttpRequestProxy.doGet(url, params , getRecEncoding());
	}

	public String queryStatus(Map params){
		String url = "http://api.map.baidu.com/trace/v2/fence/querystatus";
		return HttpRequestProxy.doGet(url, params , getRecEncoding());
	}

	public String historyalarm(Map params){
		String url = "http://api.map.baidu.com/trace/v2/fence/historyalarm";
		return HttpRequestProxy.doGet(url, params , getRecEncoding());
	}

	public String addpoint(Map params){
		String url = "http://api.map.baidu.com/trace/v2/track/addpoint";
		return HttpRequestProxy.doPost(url, params , getRecEncoding());
	}

	public String geocoder(Map params){
		String url = "http://api.map.baidu.com/geocoder/v2/";
		return HttpRequestProxy.doGet(url, params , getRecEncoding());
	}
}
